import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const state = {
  isBack: 0,
  islogin: 0,
}

const mutations = {
  BACK (state) {
    state.isBack = 1;
  },
  FORWARD (state) {
    state.isBack = 0;
  },
  LOGIN (state) {
    state.islogin = 1;
  },
  LOGOUT (state) {
    state.islogin = 0;
  }
}

const actions = {
  back ({ commit }){
    commit('BACK')
  },
  forward ({ commit }){
    commit('FORWARD')
  }
}

const store = new Vuex.Store({
  state,
  mutations,
  actions
})

export default store
